package smartq.app;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class InfoDBHelper extends SQLiteOpenHelper {
	
	public static int DB_VERSION = 1;
	public static String DB_NAME = "userinfo";
	
	public static String TABLE_NAME = "user";
	public static String TABLE_KEY_NAME = "pName";
	public static String TABLE_KEY_PHONE = "pPhone";
	public static String TABLE_CREATE_SQL = "CREATE TABLE "+TABLE_NAME + "( _id INTEGER PRIMARY KEY AUTOINCREMENT, "
											+TABLE_KEY_NAME+" TEXT, " +	
											""+TABLE_KEY_PHONE+" TEXT );";
	
	//constructor
	public InfoDBHelper(Context context){
		super(context, DB_NAME, null, DB_VERSION);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(TABLE_CREATE_SQL);
		
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE "+TABLE_NAME);
		onCreate(db);
		Log.i("Info User Name Helper", "Table upgraded from"+oldVersion+" to "+newVersion);
		
	}
	
	
}
